<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ include file="/common/taglibs.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>区域管理</title>
    <%@ include file="/common/util.jsp" %>
    <script type="text/javascript">
        function jumpPage(pageIndex) {
            window.location.href = "${cdnctx}/energy/AreaEnergy.shtml?customerinfoid=${customerInfo.id}&pageIndex=" + pageIndex;
        }
        function checkdate(date) {
            if (date > 9) {
                return date;
            } else {
                return '0' + date;
            }
        }

        function getDefault() {
            var today = new Date();
            var date = today.getDate();
            today.setDate(date - 1);
            var month = today.getMonth() + 1;
            var defaultDate = today.getFullYear() + "-" + checkdate(month) + "-" + checkdate(today.getDate());
            $('#startDate').val(defaultDate);
            $('#endDate').val(defaultDate);
        }
    </script>
</head>
<body class="main">
<div class="-frame -style -luster" id="css_container">
    <!--首页框架页眉部分↓-->
    <%@ include file="/WEB-INF/pages/inc/header.jsp" %>
    <!--首页框架页眉部分↑-->

    <div class="content">

        <!-- Left导航菜单◎开始 -->
        <%@ include file="/WEB-INF/pages/inc/leftmenu.jsp" %>
        <!-- Left导航菜单◎结束 -->
        <div class="main-mid">
            <div class="pos">
                <img src="${cdnctx}/src/index/img/index.png"><a
                    href="${cdnctx}/system/customerinfo/customerList.shtml">能源管理 </a> > <a
                    href="javascript:void(0);">${customerInfo.customername }_区域管理</a>
                <span style="float: right;margin-right: 25px;">
                    <a href="${cdnctx}/business/init.shtml?companycode=${customerInfo.companycode}">项目实施</a> |
                    <%--<a href="${cdnctx}/economicBenefit/devicestatus.shtml?companycode=${customerInfo.companycode}">设备状态</a> | --%>
                    <a href="${cdnctx}/operate/operatelist.shtml?customerinfoid=${customerInfo.id}">运营维护</a></span>
            </div>
            <div class="css_contentDiv">
                <form id="economicBenefitForm"
                      action="${cdnctx}/energy/AreaEnergy.shtml" method="post">
                    <div style="padding:10px;">
                        <input type="hidden" name="customerinfoid" value="${customerInfo.id }"/>
                        <label class="search_text">开始日期:</label>
                        <input id="startDate" class="search_input Wdate" type="text" name="startDate"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" value="${startDate }">
                        <label class="search_text">结束日期:</label>
                        <input id="endDate" class="search_input Wdate" type="text" name="endDate"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" value="${endDate }">
                        <input type="submit" class="search_btn" value="查&nbsp;询"/>
                        <input type="button" onclick="getDefault()" class="reset_btn" value="重&nbsp;置"/>
                    </div>
                </form>

                <div class="detailDiv">
                    <table class="list_table">
                        <thead>
                        <tr>
                            <%--<td>区域编号</td>--%>
                            <td>区域名称</td>
                            <td>总耗电量（度）</td>
                            <td>灯具节点</td>
                            <td>空调节点</td>
                        </tr>
                        </thead>
                        <c:if test="${empty(customerAreas) }">
                            <tr class="even" style="color:red">
                                <td colspan="10" class="no-data" style="height: 300px;"></td>
                            </tr>
                        </c:if>
                        <c:if test="${not empty(customerAreas) }">
                            <c:forEach items="${customerAreas}" var="entity" varStatus="status">
                                <tr>
                                        <%--<td>${entity.areacode}</td>--%>
                                    <td>${entity.areaname}</td>
                                    <td><fmt:formatNumber value="${entity.energy}" pattern="0.00"/></td>
                                    <td><u><a
                                            href="${cdnctx}/economicBenefit/EconomicBenefitFth.shtml?areaId=${entity.id}&customerinfoid=${customerArea.customerinfoid}&devicetype=${lighttype}">${entity.lightCount}</a></u>
                                    </td>
                                    <td><u><a
                                            href="${cdnctx}/economicBenefit/EconomicBenefitFth.shtml?areaId=${entity.id}&customerinfoid=${customerArea.customerinfoid}&devicetype=${airtype}">${entity.airCount}</a></u>
                                    </td>
                                </tr>
                            </c:forEach>
                        </c:if>
                    </table>
                </div>
                <c:if test="${not empty(customerAreas) }">
                    <div id="pageInfo" class="pageJump">
                        <script type="text/javascript">
                            pagination.getPaginationHtml('JavaScript:jumpPage({0})', ${pageIndex}, ${pageCount}, 'pageInfo');
                        </script>
                        <c:if test="${!empty(customerAreas) }">
                            共有${dataCount}条数据
                        </c:if>
                    </div>
                </c:if>
            </div>
        </div>
    </div>
</div>
<!--首页框架页尾部分↓-->
<%@ include file="/WEB-INF/pages/inc/footer.jsp" %>
<!--首页框架页尾部分↑-->
</div>
</body>
</html>
